﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Resources;
using GameDevelopHelper.Properties;
using System.Windows.Forms;
using GameDevelopHelper.Common;

namespace GameDevelopHelper.Common
{
    static class StringTable
    {
        public enum ALERT_TYPE
        {
            INFORMATION = 0,
            WARNING = 1,
            ERROR = 2
        }
        
        public static string GetAlertText(string strResName)
        {
            if (strResName.Length == 0)
            {
                return "<null>";
            }

            return Resources.ResourceManager.GetString(strResName);
        }

        public static void ResAlert(string strResName, ALERT_TYPE type)
        {
            switch (type)
            {
                case ALERT_TYPE.INFORMATION:
                    MessageBox.Show(GetAlertText(strResName), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                case ALERT_TYPE.WARNING:
                    MessageBox.Show(GetAlertText(strResName), "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                case ALERT_TYPE.ERROR:
                    MessageBox.Show(GetAlertText(strResName), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
            }
        }
    }
}
